//use one handler to handle all exception


import java.io.*;
public class Main{
	public static void main(String[] args){
		ThreadExceptionHandler handler=new ThreadExceptionHandler();

		ThreadGroup threadGroup1=new ThreadGroup("group1");
	
		Thread thread1=new Thread(threadGroup1,
			new Runnable(){
				public void run(){

					throw new RuntimeException("test fail ddddddd");
				}
			}
		);

		thread1.setUncaughtExceptionHandler(handler);
		thread1.start();
	}

}